package com.lonely.api.shein.model;


import lombok.Getter;

/**
 * 鉴权实体
 *
 * @author fzzf
 */
@Getter
public class AuthInfo {

    private SignModeEnum signModeEnum;

    /**
     * appid
     */
    private String appid;
    /**
     * appSecret
     */
    private String appSecret;

    /**
     * openKeyId，根据 get-by-token 接口获取
     */
    private String openKeyId;

    /**
     * secretKey，根据 get-by-token 接口获取，还需要密钥解密
     */
    private String secretKey;

    private AuthInfo() {

    }

    public static AuthInfo buildAuthInfo(SignModeEnum signModeEnum) {
        AuthInfo authInfo = new AuthInfo();
        authInfo.signModeEnum = signModeEnum;
        return authInfo;
    }

    public AuthInfo withAppid(String appid) {
        this.appid = appid;
        return this;
    }

    public AuthInfo withAppSecret(String appSecret) {
        this.appSecret = appSecret;
        return this;
    }

    public AuthInfo withOpenKeyId(String openKeyId) {
        this.openKeyId = openKeyId;
        return this;
    }

    public AuthInfo withSecretKey(String secretKey) {
        this.secretKey = secretKey;
        return this;
    }

}
